package uk.co.q3c.deplan.client.ui.commands;

import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import uk.co.q3c.deplan.client.Orchestrator;
import uk.co.q3c.deplan.client.domain.task.BaseTask;
import uk.co.q3c.deplan.client.ui.command.NewProjectCommand;
import uk.co.q3c.deplan.client.ui.view.Viewtags;

@Test
public class NewProjectCommand_UT extends Command_UT {
	NewProjectCommand cmd;

	@BeforeMethod
	protected void beforeMethod() {
		cmd = new NewProjectCommand();
	}

	/**
	 * test suspended
	 */
	@Test(enabled = false)
	public void testIt() {
		cmd.execute();
		// switches to project view
		Assert.assertEquals(Viewtags.ProjectView, Orchestrator.currentViewTag());
		// a new project in view (has no keyId yet - not saved)
		Assert.assertTrue(((BaseTask) Orchestrator.objectInView()).isProject());
		Assert.assertEquals(Orchestrator.objectInView()
				.getKeyId(), null);
	}

}
